<?php
/**
 * #Celebrate Shieh
 *             ,%%%%%%%%,
 *           ,%%/\%%%%/\%%
 *          ,%%%\c "" J/%%%
 * %.       %%%%/ o  o \%%%
 * `%%.     %%%%    _  |%%%
 *  `%%     `%%%%(__Y__)%%'
 *  //       ;%%%%`\-/%%%'
 * ((       /  `%%%%%%%'
 *  \\    .'          |
 *   \\  /       \  | |
 *    \\/         ) | |
 *     \         /_ | |__
 *     (___________))))))) 攻城湿
 *
 *        _       _
 * __   _(_)_   _(_) __ _ _ __
 * \ \ / / \ \ / / |/ _` |'_ \
 *  \ V /| |\ V /| | (_| | | | |
 *   \_/ |_| \_/ |_|\__,_|_| |_|
 */

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

use Illuminate\Support\Facades\Route;
use Illuminate\Support\Facades\Auth;

Auth::routes();
Route::get('getCpuUsage', 'CharController@getCpuUsage')->name('getCpuUsage');
Route::post('upload', 'UploadController@store')->name('upload')->middleware('filter');
Route::post('postFile', 'UploadController@postFile')->name('postFile')->middleware('filter');
Route::get('TextFile', 'HomeController@TextFile')->name('TextFile')->middleware('auth');//下载
Route::any('region', 'HomeController@region')->name('region');//获取地区
Route::patch('cache', 'HomeController@cache')->name('cache');//清除缓存
Route::any('user', 'HomeController@user')->name('user');//获取博客用户
Route::group([ 'middleware' => [ 'auth', 'sidebar', 'filter' ] ], function () {
    Route::get('char', 'CharController@char')->name('char');
    Route::get('/', 'HomeController@index')->name('home');
    Route::post('code', 'HomeController@code')->name('code');
    Route::group([ 'namespace' => 'Admin', 'middleware' => [ 'role' ] ], function () {
        require 'admin/system.php';
        require 'admin/blog.php';
        require 'admin/expansion.php';
    });
});
Route::group([ 'middleware' => [ 'auth', 'sidebar', 'role' ] ], function () {
    Route::get('log-viewer', '\Arcanedev\LogViewer\Http\Controllers\LogViewerController@index')->name('log-viewer::dashboard');
    Route::delete('log-viewer/logs/delete', '\Arcanedev\LogViewer\Http\Controllers\LogViewerController@delete')->name('log-viewer::logs.delete');
    Route::get('log-viewer/logs/{date}', '\Arcanedev\LogViewer\Http\Controllers\LogViewerController@show')->name('log-viewer::logs.show');
    Route::get('log-viewer/logs/{date}/download', '\Arcanedev\LogViewer\Http\Controllers\LogViewerController@download')->name('log-viewer::logs.download');
});
